package oop.java0324.firm;

import java.util.Scanner;

public class FirmTest {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Firm firm = new Firm("远方娱乐责任有限公司", "上海浦东新区", "7417417474741", "吃喝玩乐一条龙");

        while (true) {
            System.out.println("-----------------------------------");
            System.out.print("1.查看公司信息\n2.招聘员工\n3.辞退员工\n4.查看全部员工信息 \n5.查看工资最高的员工\n6.按照工资排序\n请选择：(输入0退出)");
            int no = in.nextInt();
            switch (no) {
                case 1: {
                    firm.showFirmInfo();
                    break;
                }
                case 2: {
                    Employee employee = new Employee();
                    System.out.print("姓名：");
                    employee.name = in.next();
                    System.out.print("年龄：");
                    employee.age = in.nextInt();
                    System.out.print("性别：");
                    employee.gender = in.next();
                    System.out.print("应聘的职务：");
                    employee.duty = in.next();
                    System.out.print("想要的薪资：");
                    employee.salary = in.nextDouble();
                    System.out.print("工号：");
                    employee.no = in.next();
                    firm.add(employee);
                    break;
                }
                case 3: {
                    System.out.println("输入工号：");
                    String a = in.next();
                    firm.dissmissEmployee(a);
                    break;
                }
                case 4: {
                    firm.showEmployeeInfo();
                    break;
                }
                case 5: {
                    firm.findTopSalary();
                    break;
                }
                case 6: {
                    firm.sortBySalary();
                    break;
                }
                default: {
                    System.out.println("无效序号！");
                }
            }
            if (no == 0) {
                System.out.println("退出！");
                return;
            }
        }
    }
}
